home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 24
/
Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso
/
Aminet
/
util
/
time
/
backclock.lha
/
BackClock
/
sources
/
notify.c
< prev
next >
Wrap
C/C++ Source or Header
|
1998-02-06
|
992b
|
32 lines
#include <libraries/notifyintuition.h>
#include <exec/memory.h>
#include <proto/exec.h>
#include <string.h>
#include <stdio.h>
#include "utils.h"
#define SCREEN "#?"
void startNotify(idWin * prj) {
/* initialise la notification
*/
if ((prj->Notify->inr_Name = AllocVec(strlen(SCREEN), MEMF_PUBLIC)) != NULL ){
if ((prj->notifyPort = CreateMsgPort()) != NULL) {
strcpy(prj->Notify->inr_Name, SCREEN) ;
prj->Notify->inr_Flags = INRF_SEND_MESSAGE|INRF_WAIT_REPLY|INRF_BEFORE_CLOSEWORKBENCH|INRF_AFTER_OPENWORKBENCH ;
prj->Notify->inr_stuff.inr_Msg.inr_Port = prj->notifyPort ;
prj->Notify->inr_Pri = 101 ;
prj->Notify->inr_UniqueID = 'MYCL' ;
NotIStartNotify(prj->Notify) ;
}
}
}
void endNotify(idWin * prj) {
if (prj->Notify) NotIEndNotify(prj->Notify) ;
if (prj->notifyPort) DeleteMsgPort(prj->notifyPort) ;
if (prj->Notify->inr_Name) FreeVec(prj->Notify->inr_Name) ;
}